All Questions
Tagged with algorithmsperformance
72 questions
1vote
1answer
195views
How do I narrow down a search space if symmetries are equivalent?
I have an algorithm that runs a search through every combination of a 5x5 grid where each cell can have 3 values, looking to see which combinations meet certain conditions. This gives 3^25 naive ...
0votes
3answers
754views
Why isn't a counter used to avoid nested for loops for index based operations?
Let's assume we have a method that we want to run as fast as possible and it needs to loop on a 2D array, naturally we would do a nested for loop as such: int[][] arr = new int[3][3]; for(int ...
2votes
1answer
2kviews
Multiple if condition optimization
Often I find conditional statements such as: if (life_max < max): if (expand): do life_max = max else: if (life_max > max) and not (expand): do life_max = max; Although readable, ...
5votes
4answers
641views
Processing a 2D matrix - need to speed up my O(n^4) algorithm
I have an n x n matrix which I need to convert into a list sorted by value. Starting with the maximum value cell at (row x1, col y1), I must immediately exclude all cells where (x >= x1, y <= y1)...
21votes
6answers
5kviews
Using a different algorithm depending on the size of the input
I recently finished a course on advanced algorithms, and another on complexity & computability theory, and in the past few days my mind has been somewhat preoccupied by this question. Why don't we ...
-3votes
2answers
1kviews
Which hash algorithm is best for speed and identical hashes. (a lot of collisions)
I'm searching an existing hash function or trying to make a hash function that has a lot of collisions. Regularly a hash is used for it's ability to create unique hashes for hash tables or security ...
5votes
5answers
1kviews
How can billion integer ids be stored and specific ones checked for existence most efficiently? (persistent solution, not just in-memory)
Let me preface this by saying that I am familiar with RDBMS. I have a solution using mysql/mariadb but I am not happy with the efficiency of the solution so I'm looking for alternatives. I'm trying ...
0votes
1answer
108views
Booking problem
The initial task was to find very quickly, free time for resources, let say - hotel rooms, services availability. I came with following model: Let say we have 24h in 1 day, and 365(366) days in a ...
0votes
1answer
294views
Need to test for equality on vector clocks
I've heard about vector clocks and how to test if a message was sent before another message. E.g. Message A was sent before message B if every element of the vector of message A is smaller or equal ...
2votes
1answer
117views
Quantity allocation algorithm performance
I have a scenario for which I'll take an analogous example to help understand better. There are N buckets of known varying capacities. We have M balls that we need to put in these buckets to fill ...
0votes
1answer
169views
How large-scale production web crawlers improve performance when it comes to running into already visited links
I have built a very basic webcrawler running off my laptop so it has limited memory and limited hard drive space. The way I have it now is I'm using MongoDB to store the links I find on pages. I make ...
1vote
1answer
87views
Calculation On Large File Data
I have a task where I need to read a big data file and process the data in it. Every row in the file looks like this: CustomerId ItemId Amount Price I need to calculate the total cost for the ...
-2votes
1answer
2kviews
Is algorithm performance dependent on the programming language used? [closed]
I have studied complexity of algorithms that how long an algorithm will take to execute completely, then why it is said that certain programming languages are faster than others such as C++ is faster ...
0votes
1answer
41views
Assembling random indexed packages into an ordered sequence(s)?
I am pretty confident that this is well-known and solved problem. Suppose there are n uniquely indexed "packages" randomly getting into single entry point like .AcceptPackage(Package package). ...
1vote
1answer
167views
What tools exist to determine the speed up a GPU will have on an algorithm?
Basically, I am wondering what sort of speed I will get by parallelizing a algorithm to work with GPUs. I am wondering if someone has implemented queueing theory/Amdahl's law with a UI or if everyone ...